home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 April
/
PCWorld_2001-04_cd.bin
/
Komunik
/
mozilla
/
MacOS
/
MacMozillaInstaller-0.8.sea-2.bin
/
Mozilla Installer
/
Installer Modules
/
deflenus.xpi
/
install.js
Wrap
Text File
|
2001-02-15
|
2KB
|
63 lines
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 14;
var err;
var fProgram;
// ----LOCALIZATION NOTE: translate only these ------
var prettyName = "US English Language Pack";
var regName = "defaults/mozilla/en-US";
// --- END CHANGABLE STUFF ---
err = initInstall(prettyName, regName, "5.0.0.2001021502");
logComment("initInstall: " + err);
fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if (verifyDiskSpace(fProgram, srDest))
{
err = addDirectory("",
"5.0.0.2001021502",
"viewer",
fProgram,
"",
true);
logComment("addDirectory() returned: " + err);
if (err == SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
{
cancelInstall(err);
logComment("cancelInstall due to error: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);